package file;

import java.io.File;

public class DeleteFileDemo {
    public static void main(String[] args) {
        File file = new File("Demo.txt");
        if (file.exists()) {
            file.delete();
            System.out.println("文件已删除！");
        } else {
            System.out.println("文件不存在！");
        }

        for (int i = 1; i < 101; i++) {
            File file1 = new File("test" + i + ".txt");
            file1.delete();

        }
        System.out.println("删除完毕！！！");
    }
}
